/**
 * 
 */
package edu.uwm.nlp.jude.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;



/**
 * @author qing
 *
 * Jun 15, 2009
 */
public class NumberUtil {
	
	public static boolean isNum(String str)
	{
		return str.matches("[1-9][0-9]*");
			
	}
	/**
	 * Check if there is space in a number, such as "29" is mistakenly written into "2 9"
	 * I believe this situation is rear.
	 * @param str
	 * @return
	 */
	public static String normNum(String str)
	{
		String res = new String();
		char[] chs = str.toCharArray();
		for(int i=0 ; i<chs.length; i++)
		{
			if(chs[i]>='0' && chs[i]<='9')
				res = res.concat(String.valueOf(chs[i]));
		}
		return res;
		
	}
	

}
